package com.rd.sys.dto.commmon.base;

import com.fasterxml.jackson.annotation.JsonProperty;

public class ProtalAjaxResult {
    public enum CodeEnum {
        Success(0), Failed(99);
        private int code;

        CodeEnum(int code) {
            this.code = code;
        }

        public int getCode() {
            return code;
        }

    }

    public ProtalAjaxResult(int code) {
        this.code = code;
    }

    public static ProtalAjaxResult buildFaildResult() {
        return new ProtalAjaxResult(ProtalAjaxResult.CodeEnum.Failed.getCode());
    }

    public static ProtalAjaxResult buildSuccessResult() {
        return new ProtalAjaxResult(ProtalAjaxResult.CodeEnum.Success.getCode());
    }

    @JsonProperty("code")
    private Integer code;

    @JsonProperty("description")
    private String description;

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

}
